package com.scorpio.order.service.impl;

import com.scorpio.common.service.impl.BaseServiceImpl;
import com.scorpio.order.domain.OrderEntity;
import com.scorpio.order.domain.OrderSnsEntity;
import com.scorpio.order.mapper.OrderSnsMapper;
import com.scorpio.order.service.IOrderSnsServer;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.Date;

@Service
public class OrderSnsServerImpl extends BaseServiceImpl<OrderSnsMapper, OrderSnsEntity> implements IOrderSnsServer {

    @Override
    @Transactional
    public int save(Long oid, String orderSn) {
        OrderSnsEntity snsEntity = new OrderSnsEntity();
        snsEntity.setOid(oid);
        snsEntity.setOrder_sn(orderSn);
        snsEntity.setCreate_time(new Date());
        return baseDao.insert(snsEntity);
    }

}
